import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import Home from '../pages/Home.vue'
const About = () => import('../pages/about')
const Mime = () => import('../pages/Mime.vue')
import NotFound from '../pages/NotFound.vue'
import AboutAddress from '../pages/about/pages/AboutAddress.vue'
import AboutCompany from '../pages/about/pages/AboutCompany.vue'

// 配置映射关系
const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    component: Home,
    name: 'home',
  },
  {
    path: '/about',
    component: About,
    children: [
      {
        path: '/about',
        redirect: '/about/company',
      },
      {
        path: '/about/company',
        component: AboutCompany,
      },
      {
        path: 'address',
        component: AboutAddress,
      },
    ],
  },
  {
    path: '/mime',
    component: Mime,
  },
  {
    path: '/:pathMatch(.*)*',
    component: NotFound,
  },
]
const router = createRouter({
  routes,
  history: createWebHistory(),
})
export default router
